package com.dongwq

class DashbordController {

   //static navigation = [ group:'tabs', order:10, title:'Your Inbox', action:'inbox' ]

	static navigation = [
		group:'dashbord', 
		order:30, 
		title:'DashBord', 
		action:'index',
		subItems: [
			[action:'newInbox', order:1, title:"dashItem1"],
			[action:'archive', order:10, title:'dashItem2']
		]
	]
	
	def index = { }

	def inbox = {
		def user = User.get(params.id)
		if(user) {
			[items:Inbox.findAllByUser(user)]
		}

		render(text:"no inbox info")
	}
	
	def newInbox = { [items:Inbox.findAllByUserAndArchive(user, false)]}
	
	def archive = { [items:Inbox.findAllByUserAndArchive(user, true)]}
	
}
